/*
 * second.cpp
 *  The second C++ program for CSIS 328 - shows how to use
 *  the string object and floats.
 *  Created on: 2010-03-16
 *      Author: Anthony Varghese
 */
#include <string>
#include <iostream>
using namespace std;

int main() {
	/*
	 * First print Hello and then start a new line (endl)
	 */
	string s1 = "Hello!";
	cout << s1 << endl;


	/*
	 * Next, compute the circumference of a circle and print it.
	 */
	const float PI = 3.1415;
	float radius = 10.0;
	string srad = " A circle with radius ";
	float circumference = 2.0 * PI * radius * radius;
	string scirc = " will have a circumference of ";

	cout << srad << radius
	     << scirc << circumference
	     << endl;


	/*
	 * Finally, set up and print an array of integers
	 */
	const int arraysize = 20;
	int numbers[arraysize];
	for (int i=0; i<arraysize; i++)
		numbers[i] = (i + 1) * 10;
	cout << endl << " Contents of the array:" << endl;
	for (int i=0; i<arraysize; i++)
		cout << "    at location " << i << ":  " << numbers[i] << endl;

	cout << "Done!";
	return 0;
}

